﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Controls;
using Xceed.Wpf.AvalonDock.Layout;
using System.Windows;
using TraceInspector.ViewModel;

namespace TraceInspector.UI.WPF
{
    public class AvalonDockLayoutItemTemplateSelector : DataTemplateSelector
    {
        public override System.Windows.DataTemplate SelectTemplate(object item, System.Windows.DependencyObject container)
        {
            FrameworkElement element = container as FrameworkElement;
            
            if (item is InspectionViewModel)
            {
                return element.FindResource("LayoutDocumentTemplate") as DataTemplate;
            }
            return base.SelectTemplate(item,container);
        }
    }
}
